package org.example.model;

import lombok.Data;

@Data
public class HttpResult {
    private String message;
    private boolean success;
    private Object data;
    public static HttpResult success(Object data){
        HttpResult httpResult=new HttpResult();
        httpResult.setMessage(null);
        httpResult.setSuccess(true);
        httpResult.setData(data);
        return httpResult;
    }
    public static HttpResult internalError(){
        HttpResult httpResult=new HttpResult();
        httpResult.setMessage("系统内部错误");
        httpResult.setSuccess(false);
        return httpResult;
    }
    public static HttpResult bizError(String msg){
        HttpResult httpResult=new HttpResult();
        httpResult.setMessage(msg);
        httpResult.setSuccess(false);
        return httpResult;
    }
}
